<?php
namespace App\Controller;
use Think\Controller;
class CoachController extends Controller {
    public function index(){

    }
    public function coachjson(){
        //薛烜做的获取教练信息详情8.24
        $data = M('coach');
        $coachid = $_GET['coachid'];
       
        //$d=$data->join('yuejian_club on yuejian_club.clubid = yuejian_coach.clubid')->field('yuejian_coach.*,yuejian_club.clubname')->select(); 

        $d=$data->join('yuejian_club on yuejian_club.clubid = yuejian_coach.clubid')->field('yuejian_coach.coachname,yuejian_coach.coachintroduce,yuejian_coach.coachphoto,yuejian_club.clubname')->where("coachid='$coachid'")->select(); 

        var_dump($d);
        echo json_encode($d);
	
    }


    public function coachjson1(){
        //薛烜做的获取教练信息列表8.24
         
            $data = M('coach');

            $s=$data->field('yuejian_coach.coachname,yuejian_coach.coachphoto')->select(); 

            var_dump($s);
            echo json_encode($s);

            

            
        }

}